﻿using System;
using System.Collections.Generic;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Linq;
using System.Reflection;
using System.Text;

namespace Azad.BCL
{
    [Database(Name = "Blog")]
    public class MultipleRecordSet : DataContext
    {
        private static System.Data.Linq.Mapping.MappingSource mappingSource = new AttributeMappingSource();
       //public MultipleRecordSet() : 
       //         base(global::Azad.BCL.Properties.Settings.Default.admin_AzadConnectionString1, mappingSource)
       // {
       //      //OnCreated();
       // }
		
		public MultipleRecordSet(string connection) : 
				base(connection, mappingSource)
		{
            //OnCreated();
		}
		
		public MultipleRecordSet(System.Data.IDbConnection connection) : 
				base(connection, mappingSource)
		{
            //OnCreated();
		}
		
		public MultipleRecordSet(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
            //OnCreated();
		}

        public MultipleRecordSet(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) : 
				base(connection, mappingSource)
		{
            //OnCreated();
		}
        [Function(Name = "dbo.GetCustomerReport")]
        public IMultipleResults GetCustomerReport(System.Nullable<int> customerId)
        {
            IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), customerId);
           // return ((ISingleResult<GetCustomerReportResult>)(result.ReturnValue));
            if (result != null) return (IMultipleResults)(result.ReturnValue);
            return null;
        }
    }
    public interface IMultipleResults : IFunctionResult, IDisposable
    {

        IEnumerable<TElement> GetResult<TElement>();

    }

}
